<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@page import="jp.co.lkg.springsmp.common.*"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="webctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta >
<title></title>
<%SimpleDateFormat number = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); %>
<link rel="stylesheet" href="${webctx}/resources/css/loginstyle.css">
<spring:url value="/resources/js/jquery.min.js" var="jquery" />
<script src="${jquery}"></script>
<spring:url value="/resources/js/jquery.validate.min.js?var1.14.0" var="validate" />
<script src="${validate}"></script>

<script type="text/javascript">
function phoneLogin() {
	$('#phoneloginForm').attr('action', "plogin");
	$('#phoneloginForm').submit();
}
function getCode(){
	var phone=document.getElementById("phone").value;
		$.ajax({
			url:"http://localhost:8080/Flower/user/getCode",
			dataType:"json",
			type : "POST",
			data:{
				phone:phone
			},
			success:function(data){},
			error:function(data){}
		})
	}
	
function toRegister(){
	  $('#loginForm').attr('action', "toregister");
	  $('#loginForm').submit();
}
</script>
</head>
<body style="background-image: url(${webctx}/resources/images/1.jpg);width:100%;height:100%">

<div class="login-container">
	<h1>欢迎您登陆</h1>
	
	<div class="connect">
		<p>现在时间为：<%=number.format(new Date()) %></p>
	</div>
	
	<form id="phoneloginForm"  method="post" action="userinfoForm">
		<div>
			<input type="text" name="searchDto.phone" id="phone"  placeholder="请输入手机号" />
		</div>
		<div>
		<input type="button" onclick="getCode()" value="获取验证码">
		</div>
		<div>
		<input type="text" name="searchDto.code"  placeholder="请输入验证码" />
		</div>
		<%
			String msg = (String)request.getAttribute("msg");
			if (!TextUtils.isEmpty(msg)) {
				%>
				<%= msg %>
				<%
			}
			%>
		<button id="submit" onclick="phoneLogin()">登 陆</button>
		<button id="submit1" onclick="toRegister()">注册</button>
		
	</form>

	

</div>
 

</body>
</html>